package com.zara.store.server;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;

import com.zara.store.common.EnvtVO;

@Entity
public class Envt{

	private int id;
	private Date date;
	
	public Envt() {
		// hib;
	}

	public Envt(EnvtVO envtVO) {
		this.date = envtVO.getDate();
	}

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO) 
	public int getId(){
		return id;
	}

	public void setId(int newVal){
		id = newVal;
	}

	@Column
	public Date getDate(){
		return date;
	}

	public void setDate(Date newVal){
		date = newVal;
	}

	@Transient
	public EnvtVO toVO() {
		EnvtVO envtVO = new EnvtVO();
		envtVO.setDate(date);
		return envtVO;
	}
	
}